import 'package:flutter/material.dart';
import 'package:flutter_app/core/utils/logger.dart';
import 'package:go_router/go_router.dart';

/// The details screen
class DemoPage extends StatelessWidget {
  const DemoPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Details Screen')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () => context.go('/'),
              child: const Text('Go back to the Home screen'),
            ),
            const SizedBox(height: 16),
            ElevatedButton(
              onPressed: () => context.go('/tabBarDemo'),
              child: const Text('go tabBarDemo'),
            ),
            const SizedBox(height: 16),
            ElevatedButton(
              onPressed: () => context.go('/sqlite'),
              child: const Text('sqlite 基础操作'),
            ),
            const SizedBox(height: 16),
            ElevatedButton(
              onPressed: () => context.go('/network'),
              child: const Text('网络请求 基础操作'),
            ),
            const SizedBox(height: 16),
            //点击触发事件
            ElevatedButton(
              onPressed: () => {
                AppLogger.i("图片预览 基础操作"),
                AppLogger.d("图片预览 基础操作"),
                AppLogger.w("图片预览 基础操作"),
                AppLogger.e("图片预览 基础操作"),
                context.go('/image')},
              child: const Text('图片预览 基础操作'),
            ),
            const SizedBox(height: 16),
            ElevatedButton(
              onPressed: () => context.go('/video'),
              child: const Text('视频播放 基础操作'),
            ),
          ],
        ),
      ),
    );
  }
}
